package com.example.demo.Service;

import com.example.demo.Entity.User;
import com.example.demo.Mapper.UserMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service //服务层标签
public class UserService {
    @Autowired //属性注入   将UserMapper放入到Spring容器中
    public UserMapper userMapper;
    public List<User> getAll(){
        return userMapper.getAll();
    }
    public  List<User> getById(@Param("id") Integer id){
        return userMapper.getById(id);

    }
}
